from django.db import models
from django.contrib.auth.models import AbstractUser

class Readers(AbstractUser):
    student_number = models.CharField(max_length=50, blank=True, null=True)
    contact_info = models.CharField(max_length=100, blank=True, null=True)
    name = models.CharField(max_length=100, blank=True, null=True)
    # 使用related_name来避免反向访问器冲突
    groups = models.ManyToManyField(
        'auth.Group',
        related_name='readers_groups',  
        blank=True,
        help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.'
    )
    user_permissions = models.ManyToManyField(
        'auth.Permission',
        related_name='readers_user_permissions', 
        blank=True,
        help_text='Specific permissions for this user.'
    )